//
//  YLTool.h
//  YLTool
//
//  Created by EmberWei on 2018/7/30.
//  Copyright © 2018年 EmberWei. All rights reserved.
//

#import <Foundation/Foundation.h>


#define BASE_URL @"http://223.71.180.203:8081"
#define IMAG_URL @"http://223.71.180.203:8081"

#define ErrorStr @"请求失败..."


typedef void (^Success)(NSDictionary * _Nonnull JSON);
typedef void (^Failure)(NSString * _Nonnull error);

@interface YLTool : NSObject

/**
 * GET请求
 *  @param path URL地址路径
 *  @param params 参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */

+ (void)GET:(NSString * _Nonnull)path
     params:(NSDictionary * _Nullable)params
    success:(Success _Nullable)success
    failure:(Failure _Nullable)failure;

/**
 * POST请求
 *  @param path URL地址路径
 *  @param params 参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */

+ (void)POST:(NSString * _Nonnull)path
      params:(NSDictionary * _Nullable)params
     success:(Success _Nullable)success
     failure:(Failure _Nullable)failure;

@end
